include $(WORKDIR)/config.mk

CUR_DIR := $(shell pwd)
LOCAL_INCLUDES := $(PLAT_INC_DIR)
LOCAL_INCLUDES += $(MPI_INC_DIR)
LOCAL_INCLUDES += $(APP_INC_DIR)
LOCAL_INCLUDES += $(CUR_DIR)/akipc/include/

PRODUCT_TEST_DIR := $(CUR_DIR)/product_test/output/
DAEMON_DIR := $(CUR_DIR)/daemon/

CFLAGS += $(addprefix -I,$(LOCAL_INCLUDES))

export LOCAL_INCLUDES PRODUCT_TEST_DIR DAEMON_DIR

dir_y :=
dir_y += updater
dir_y += discovery
dir_y += akipc
dir_y += daemon
dir_y += ccli
dir_y += cmd_serverd
dir_y += disk_repair
dir_y += mmc_test
dir_y += version

ifeq ($(CONFIG_DANA_SUPPORT)_$(CONFIG_ONVIF_SUPPORT)_$(CONFIG_RTSP_SUPPORT), n_n_y)
	dir_y += product_test
endif

all:
	@for i in $(dir_y); \
	do \
		$(MAKE) -C $$i; \
		if [ $$? -ne 0 ];then exit 1; fi \
	done

install:
	@for i in $(dir_y); \
	do \
		$(MAKE) -C $$i install; \
	done

clean:
	@for i in $(dir_y); \
	do \
		$(MAKE) -C $$i clean; \
	done

image:

.PHONY: all install clean
